<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="keywords" content="" />
<meta name="description" content="" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<title>任务列表</title>
<link rel="stylesheet" href="/css/css2.css" type="text/css">
	<script type="text/javascript" src="/js/jquery-3.5.1.min.js"></script>
<style>
	.fanhui{
		display: inline-block;
		float:right;
		padding: 0px;
		font-size:20px;
		margin-left: -45px;
	}
</style>
</head>
<body>
   <div class="topbanner">任务列表<div class="fanhui" onclick="fanhui()">返回</div></div>
   <h3 class="h3_tit">任务列表</h3>
   <div class="main RW_jilu"> 
	   <table border="1" cellspacing="0" cellpadding="0">
		  <thead>
			<tr>
			  <th>时间</th>
			  <th>任务</th>
			  <th>状态</th>
			</tr>
		  </thead>
		  <tbody id="rebwujilu">
		  </tbody>
		</table>
	</div>
</body>

<script type="text/javascript" th:inline="javascript">
	var url = 'http://eyemonitor-api.dddmaker.com'
//    var url = 'http://121.36.8.243:8083'
	let pcorapp=[[${pcorapp}]];
     var school = [[${school}]];
     var checkType = [[${checkType}]];
     var CityName = [[${CityName}]];
     var AreaName = [[${AreaName}]];
    $.ajax({
        cache: true,
        type: "GET",
        url: url+"/api/gift/getBatchRenwu",
        data: {pcorapp},
        async: false,
        success: function (data) {console.info(data)
           let tr="";
           let da = data.data||[];
           for(let userTaskDO of da){
			  tr+= `<tr onClick="getRenwuDetail('${userTaskDO.pcorapp}','${userTaskDO.startTime}',${userTaskDO.taskTime})">
				   <td>${userTaskDO.sstime}</td>
				   <td>${userTaskDO.taskTime}天任务</td>
				   <td class="yesWC">${userTaskDO.finishStatus==1?"已结束":"进行中"}</td>
					   </tr>`;
		   }
		   $("#rebwujilu").html(tr);
			if(da.code==-1){
			    alert("还没有进行过任务...");
			}
        },
        error: function (request) {
            alert("Connection error");

        },
    });

    function getRenwuDetail(pcorapp,startTime,taskTime){
        window.location.href="/Newhuyan/getRenwuDetail?pcorapp="+pcorapp+"&startTime="+startTime+"&taskTime="+taskTime;

    }

    function fanhui(){
        window.location.href="/skip/Newhuyan?school="+school+"&checkType="+checkType
        +"&CityName="+CityName+"&AreaName="+AreaName;
	}

    </script>
</html>



